<?php


namespace Modules\Admin\Http\Controllers\Authorization\Role;


use Modules\Common\General\Security\Authorization\Manager;
use Modules\Common\Util\Api;

class AddPermission
{
    /**
     * @Route(path=/api/admin/authorization/role/permission method=post)
     */
    public function index()
    {
        Api::validate( ['role_id' => 'integer', 'branch_id' => 'integer', 'permission_ids' => 'array[integer]']);
        $m = new Manager();
        $m->addPermissionsForRole(request('role_id'), request('permission_ids'),request('branch_id'));
        return Api::success();
    }

}
